package com.nsn.das;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class StartupListener extends ContextLoaderListener implements ServletContextListener {

	private static final Log log = LogFactory.getLog(StartupListener.class);

	public void contextInitialized(ServletContextEvent event) {
		java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("Etc/UTC"));
	    // call Spring's context ContextLoaderListener to initialize
	    // all the context files specified in web.xml
	    super.contextInitialized(event);
		AppCtxHolder.setApplicationContext(WebApplicationContextUtils.getRequiredWebApplicationContext(event.getServletContext()));		
	}
}
